Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimRadio: clean-up and emulate collisions #5487

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

GUVWAF
Copy link
Member

@GUVWAF GUVWAF commented Dec 1, 2024

This cleans up some of the guarding for the simulator. Actually all Portduino variants have HAS_RADIO still set to 0, but only when the SimRadio is actually initialized, we should handle the packets from the simulator. HAS_RADIO can now thus be set to 1 for Portduino as well, and when it doesn’t have a radio configured, it will fall back to SimRadio.

Also, the simulator can’t handle PKC packets, so this avoids using it when SimRadio is used.

Furthermore, SimRadio now emulates collisions when it receives a packet while it is currently sending or receiving another one. Those bad packets are now counted as well, and sent with the LocalStats.

@GUVWAF GUVWAF marked this pull request as draft December 2, 2024 07:33
@GUVWAF
Copy link
Member Author

GUVWAF commented Dec 2, 2024

Converted to draft for now, would probably be nice to be able to disable the emulation of collisions.

@GUVWAF GUVWAF marked this pull request as ready for review December 2, 2024 18:13
@thebentern thebentern merged commit 57ea6a2 into meshtastic:master Dec 3, 2024
47 checks passed
fifieldt pushed a commit to nebman/meshtastic-firmware that referenced this pull request Dec 14, 2024
* Clean up SimRadio and don't let it use PKC

* Add collision emulation for SimRadio

* Add stats from SimRadio to LocalStats

* Make emulating collisions optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants